<template>
  <div>
    <h2>User</h2>
    count: {{ store.count }}
    <hr>
    lastName: {{ store.lastName }}
    <hr>
    firstName: {{ store.firstName }}

    <hr>
    <button @click="updateState">更新</button>
  </div>
</template>
<script setup>
import { useUsersStore } from '../store.js'
const store = useUsersStore();
function updateState() {
  /* store.$patch({
    count: 100,
    lastName: 'lili',
    firstName: 'sun'
  }) */
  store.$patch((state) => {
    state.count = 200;
    state.lastName = 'lucy';
    state.firstName = 'sun';
  });
}

console.log(store.$state);

</script>
